/*
* ECARX Technology Limited is the owner of the copyright and the trade secret of this software.
* Without permission, no one has the right to obtain, disclose or use this software in any way.
*/

package ecarx.xsf.notificationcenter.base.push.model.upload;

import android.os.Parcel;
import android.os.Parcelable;


/**
 * 上传数据至推送接口V2时所需的可选参数POJO
 */
public class PushOptionModel implements Parcelable {

    private boolean isOffline;
    private long pushTime;
    private long expireTime;

    public PushOptionModel() {

    }

    public boolean isOffline() {
        return isOffline;
    }

    public void setOffline(boolean offline) {
        isOffline = offline;
    }

    public long getPushTime() {
        return pushTime;
    }

    public void setPushTime(long pushTime) {
        this.pushTime = pushTime;
    }

    public long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(long expireTime) {
        this.expireTime = expireTime;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByte((byte) (this.isOffline ? 1 : 0));
        dest.writeLong(this.pushTime);
        dest.writeLong(expireTime);
    }

    public PushOptionModel(Parcel in) {
        this.isOffline = in.readByte() != 0;
        this.pushTime = in.readLong();
        this.expireTime = in.readLong();
    }

    public static final Creator<PushOptionModel> CREATOR = new Creator<PushOptionModel>() {
        @Override
        public PushOptionModel createFromParcel(Parcel source) {
            return new PushOptionModel(source);
        }

        @Override
        public PushOptionModel[] newArray(int size) {
            return new PushOptionModel[size];
        }
    };

}
